import { getManuEntryList } from '@/api/manageEnd/manuscript/entryManu'
import { pendingReviewManuAdd } from '@/api/manageEnd/manuscript/pendingReview'

export default {
  methods: {
    async getManuEntryList(params) {
      this.tableLoading = true
      const res = await getManuEntryList(params)
      const data = res.data.data || {}
      this.tableData = Object.freeze(data.data || [])
      this.pagination.total = data.count || 0
      this.tableLoading = false
    },

    async pendingReviewManuAdd(data) {
      const res = await pendingReviewManuAdd(data)
      const status = res.data.status
      if (status === 0) {
        this.$refs['modalUploadRef'].open_uploadScuuess()
        this.handleFormSubmit()
      } else {
        this.$refs['modalUploadRef'].open_uploadFailed()
        setTimeout(() => this.$refs['modalUploadRef'].close_uploadFailed(), 1200)
      }
    },
  },
}
